package com.example.mappers;

import com.example.data.approval.ApprovalDO;
import com.example.data.approval.Approval;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ApprovalRowMapper implements RowMapper<Approval> {
    @Override
    public Approval mapRow(ResultSet rs,int i) throws SQLException {
        Approval approvalDo = new ApprovalDO();

        approvalDo.setEmpID(rs.getLong("empId"));
        approvalDo.setTime(rs.getTime("time"));
        approvalDo.setAppID(rs.getLong("appId"));
        approvalDo.setType(rs.getInt("approvalType"));
        approvalDo.setApproval(rs.getBoolean("authorize"));
        approvalDo.setComment(rs.getString("comment"));

        return approvalDo;
    }
}

